package com.esri.core.internal.tasks.e.a;

import com.esri.core.geometry.Envelope;
import java.util.Map;

/* loaded from: classes.dex */
public class e extends i {
    private static final long serialVersionUID = 1;
    String a;
    private String[] e;
    private String f;
    private Envelope g;
    private int h;
    private int i;
    private boolean j;

    public e(String str, String[] strArr, String str2, Envelope envelope, int i, int i2, String str3, boolean z) {
        super("GetMap");
        this.e = null;
        this.h = -1;
        this.i = -1;
        b(str);
        if (str3 != null) {
            this.a = str3;
        } else {
            this.a = "image/png";
        }
        this.e = strArr;
        this.f = str2;
        a(envelope);
        a(i);
        b(i2);
        this.j = z;
    }

    public String[] a() {
        return this.e;
    }

    public String b() {
        return this.f;
    }

    public void a(Envelope envelope) {
        this.g = envelope;
    }

    public Envelope c() {
        return this.g;
    }

    public void a(int i) {
        this.h = i;
    }

    public int d() {
        return this.h;
    }

    public void b(int i) {
        this.i = i;
    }

    public int e() {
        return this.i;
    }

    @Override // com.esri.core.internal.tasks.e.a.i, com.esri.core.internal.tasks.f
    public Map<String, String> generateRequestParams() {
        Map<String, String> generateRequestParams = super.generateRequestParams();
        generateRequestParams.put("LAYERS", com.esri.core.internal.util.a.a(this.e, ","));
        generateRequestParams.put(f.d.equals(this.b) ? "CRS" : "SRS", this.f);
        if (g.a(this.b, this.f)) {
            generateRequestParams.put("BBOX", String.format("%s,%s,%s,%s", Double.valueOf(this.g.getYMin()), Double.valueOf(this.g.getXMin()), Double.valueOf(this.g.getYMax()), Double.valueOf(this.g.getXMax())));
        } else {
            generateRequestParams.put("BBOX", String.format("%s,%s,%s,%s", Double.valueOf(this.g.getXMin()), Double.valueOf(this.g.getYMin()), Double.valueOf(this.g.getXMax()), Double.valueOf(this.g.getYMax())));
        }
        generateRequestParams.put("WIDTH", Integer.toString(this.h));
        generateRequestParams.put("HEIGHT", Integer.toString(this.i));
        generateRequestParams.put("TRANSPARENT", this.j ? "TRUE" : "FALSE");
        StringBuilder sb = new StringBuilder("");
        for (int i = 1; i < this.e.length; i++) {
            sb.append(",");
        }
        generateRequestParams.put("STYLES", sb.toString());
        String str = this.a;
        if (str != null && str.length() > 0) {
            generateRequestParams.put("FORMAT", this.a);
        }
        return generateRequestParams;
    }

    @Override // com.esri.core.internal.tasks.f
    public boolean validate() {
        String[] strArr;
        return f() != null && f().length() > 0 && (strArr = this.e) != null && strArr.length > 0 && this.f != null && this.g != null && this.h > -1 && this.i > -1;
    }
}
